<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      layout:decorator="admin/layout">
<head>
    <title th:inline="text">Admin | Blog | [[${post.title}]]</title>
</head>
<body>
<nav layout:fragment="~{breadcrumb}">
    <ul>
        <li><a th:href="@{/admin}">Admin</a></li>
        <li><a th:href="@{/admin/blog}">Blog</a></li>
        <li class="is-active"><a th:href="@{'/admin/blog/' + ${post.id} + '/edit'}" aria-current="page">Edit Blog Post</a></li>
    </ul>
</nav>
<div layout:fragment="~{content}">
    <form layout:include="admin/blog/_post_form :: post-form" th:with="edit=1" th:action="@{'/admin/blog/' + ${post.id} + '/edit'}"
          method="post" th:object="${postForm}"></form>
    <form th:action="@{'/admin/blog/' + ${post.adminSlug}}" method="post">
        <input type="hidden" name="_method" value="DELETE"/>
        <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
        <div class="buttons">
            <button class="button is-danger" type="submit" name="delete">Delete</button>
        </div>
    </form>
</div>
</body>
</html>